<?php
 
   if(!isset($_SESSION)){
session_start();
}
  
    if(isset($_POST['username'])&&isset($_POST['password'])){
        
        if($_POST['username']=="admin"&&$_POST['password']=="admin"){
         $_SESSION['logged']=true;
        header("location: index.php");
        }
        else{
            $msg="Mot de passe saisi est faux";
        }
        
    }
     include '../Include/header.inc.php';
    include '../Include/funcGestionMedia.inc.php';

    
    

        
        
?>   
<div id="form_container">
    <div align="center"><h2>Login</h2></div>

	
		<form method='POST' name='formLogin' action='login.php' >
		<?php if(isset($msg))echo "<span style='background-color:orange;align=center' >".$msg."</span>"; ?>
		<table width='40%'>
		<tr>
		<td>Utilisateur: </td>
		<td><input type='text' name='username'/></td>
		</tr>
		<tr>
		<td>Mot de passe: </td>
		<td><input type='password' name='password'/></td>
		</tr>
		<tr>
		<td><input type='submit' name='login' value='Connexion' /></td>
		
		
		</tr>
		</table>
		
		</form>
                
</div>
